<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<title>jqTabula</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

	<link media="all" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/base/jquery-ui.css" rel="stylesheet" />
</head>

<body>

<br/>

<div id="test-div">
</div>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="./js/jqtabula.js"></script>

<script type="text/javascript">
	jQuery(document).ready(
		function(){
			try{
				var title = new jqt.Align(jqt.VERTICAL.TOP, jqt.HORIZONTAL.CENTER);
				var data = new jqt.Align(jqt.VERTICAL.MIDDLE, jqt.HORIZONTAL.CENTER);

				console.log(data.getVertical());
				console.log(title.toString());

				var align = {"title": title, "data": data};
				var filter = null; //TODO jqt.Filter class
				var sortOrder = new jqt.SortOrder(true, jqt.SORT_DIRECTION.ASCENDING, 0);

				var column = new jqt.model.Column("title", "fieldName", Number, sortOrder, filter, align);

				var header = new jqt.view.Header(jQuery("#test-div"));
			}catch(e){
				alert(e.msg);
				alert(e);
			}


			try{
//				var table = new jqt.Table(jQuery("#test-div"), new jqt.controller.LocalDataHandler(null));
				var table = new jqt.Table(jQuery("#test-div"), new jqt.controller.AjaxDataHandler("http://localhost:8080/oms/entity/x?json=", new jqt.Pager(0, 20)));
				table.load();
				table.draw();
			}catch(e){
				alert(e.msg);
				alert(e);
			}
		});
</script>
</body>
</html>

